import request from '@/utils/request'


// 投资列表
export function findAllManageByPage(data) {
  return request({
    url: '/invest/manage/findAllManageByPage',
    method: 'post',
    data
  })
}

// 添加投资
export function addInvestManage(data) {
  return request({
    url: '/invest/manage/addInvestManage',
    method: 'post',
    data
  })
}

// 修改投资
export function portfolioUpdateById(data) {
  return request({
    url: '/invest/manage/updateById',
    method: 'post',
    data
  })
}

// 投资详情
export function getInvestHeadDetial(data) {
  return request({
    url: '/invest/manage/getInvestHeadDetial',
    method: 'post',
    data
  })
}

// 根据投资id获取投后净值  (净值曲线)
export function getNetWorthByInvestId(data) {
  return request({
    url: '/invest/manage/getNetWorthByInvestIdNew',
    method: 'post',
    data
  })
}
// export function getNetWorthByInvestIdNew(data) {
//   return request({
//     url: '/invest/manage/getNetWorthByInvestIdNew',
//     method: 'post',
//     data
//   })
// }


// 投后管理-根据投资id拟合净值 (拟合曲线)
export function getFitNetWorthValue(data) {
  return request({
    url: '/invest/manage/getFitNetWorthValue',
    method: 'post',
    data
  })
}

// // 根据组合id查详情
// export function findPortFolioDetial(data) {
//   return request({
//     url: '/invest/strategy/findPortFolioDetial',
//     method: 'post',
//     data
//   })
// }

// 根据组合id查详情
export function findStrategyByPortfolioId(data) {
  return request({
    url: '/invest/strategy/findStrategyByPortfolioId',
    method: 'post',
    data
  })
}

// 根据策略id数组查策略
export function findStrategyByStrategyIds(data) {
  return request({
    url: '/invest/strategy/findStrategyByStrategyIds',
    method: 'post',
    data
  })
}


////////////////////////////////////// 重构


// 添加投资
export function addInsertManage(data) {
  return request({
    url: '/invest/manage/insertManage',
    method: 'post',
    data
  })
}

// 添加投资
export function updateManage(data) {
  return request({
    url: '/invest/manage/updateManage',
    method: 'post',
    data
  })
}

// 根据id查询策略详情
export function queryById(data) {
  return request({
    url: '/invest/manage/queryById',
    method: 'post',
    data
  })
}

// // 根据id查询投资详情
// export function queryInvestDetailById(data) {
//   return request({
//     url: '/invest/manage/queryInvestDetailById',
//     method: 'post',
//     data
//   })
// }

// 子账号下拉菜单接口
export function listChildrenAccount(data) {
  return request({
    url: '/invest/sys/user/listChildrenAccount',
    method: 'post',
    data
  })
}

// 关联投资列表 根据投资id查关联策略列表
export function findAllDetailByPage(data) {
  return request({
    url: '/invest/manage/findAllDetailByPage',
    method: 'post',
    data
  })
}

// 添加策略
export function insertDetail(data) {
  return request({
    url: '/invest/manage/insertDetail',
    method: 'post',
    data
  })
}

// 修改策略
export function updateDetail(data) {
  return request({
    url: '/invest/manage/updateDetail',
    method: 'post',
    data
  })
}

// 投资下策略id查策略详情
export function queryInvestDetailById(data) {
  return request({
    url: '/invest/manage/queryInvestDetailById',
    method: 'post',
    data
  })
}

///////// 投后净值

// 投后净值风险指标 
export function getRiskInditor(data) {
  return request({
    url: '/invest/manage/getRiskInditor',
    method: 'post',
    data
  })
}

// 投后净值月度表现
export function getMonthlyIncrease(data) {
  return request({
    url: '/invest/manage/getMonthlyIncrease',
    method: 'post',
    data
  })
}

//投后净值分析-月度汇报列表(分页)
export function getInvestMonthNetWorthDetial(data) {
  return request({
    url: '/invest/manage/getInvestMonthNetWorthDetial',
    method: 'post',
    data
  })
}

// 投后净值收益分布    （月度回报图）
export function getMonthInvestNetWorthDistributed(data) {
  return request({
    url: '/invest/manage/getMonthInvestNetWorthDistributed',
    method: 'post',
    data
  })
}

// 投后净值分析直方图  收益分布图
export function monthlyNetworthHistogram(data) {
  return request({
    url: '/invest/manage/monthlyNetworthHistogram',
    method: 'post',
    data
  })
}

// 投后净值获取1月3月6月收益情况
export function findNetWorthBySegment(data) {
  return request({
    url: '/invest/manage/findNetWorthBySegment',
    method: 'post',
    data
  })
}

// 分页获取投后历史净值
export function findNetWorthByPage(data) {
  return request({
    url: '/invest/manage/findNetWorthByPage',
    method: 'post',
    data
  })
}

// 投后净值详情接口
export function getInvestStrategyDetial(data) {
  return request({
    url: '/invest/manage/getInvestStrategyDetial',
    method: 'post',
    data
  })
}

// 投资管理-获取相对净值  (历史走势图)
export function findRealityInvestNetWorthByStrategyId(data) {
  return request({
    url: '/invest/manage/findRealityInvestNetWorthByStrategyId',
    method: 'post',
    data
  })
}

// 投后净值最大回撤
export function findMaxDown(data) {
  return request({
    url: '/invest/manage/findMaxDown',
    method: 'post',
    data
  })
}

// 子投资手动添加净值
export function insertInvestNetworth(data) {
  return request({
    url: '/invest/manage/insertInvestNetworth',
    method: 'post',
    data
  })
}

// 投资手动录入净值
export function addManageNetWorth(data) {
  return request({
    url: '/invest/manage/addManageNetWorth',
    method: 'post',
    data
  })
}

// 根据投资ID获取所有母盘账号详情
export function findAccountByInvestId(data) {
  return request({
    url: '/invest/manage/findAccountByInvestId',
    method: 'post',
    data
  })
}

// 根据投资ID获取所有母盘账号权益曲线
export function findEquityByInvestId(data) {
  return request({
    url: '/invest/manage/findEquityByInvestId',
    method: 'post',
    data
  })
}

// 获取母盘所有账号拟合曲线
export function findAccountEquityFit(data) {
  return request({
    url: '/invest/manage/findAccountEquityFit',
    method: 'post',
    data
  })
}


// 投资明细净值曲线
export function findAccountEquity(data) {
  return request({
    url: '/invest/manage/findAccountEquity',
    method: 'post',
    data
  })
}

// 根据投资ID获取资金的历史纪录
export function queryEquityHistory(data) {
  return request({
    url: '/invest/manage/queryEquityHistory',
    method: 'post',
    data
  })
}

/////////////////////////  策略明细

// 投资明细-最大回撤
export function findInvestManageMaxDown(data) {
  return request({
    url: '/invest/manage/findInvestManageMaxDown',
    method: 'post',
    data
  })
}

// 投资明细-月度表现列表
export function getInvestMonthlyIncrease(data) {
  return request({
    url: '/invest/manage/getInvestMonthlyIncrease',
    method: 'post',
    data
  })
}

// 投资明细-收益分布
export function getMonthInvestEquityDistributed(data) {
  return request({
    url: '/invest/manage/getMonthInvestEquityDistributed',
    method: 'post',
    data
  })
}

// 投资明细-每月的增长率 净值列表
export function getInvestMonthEquityDetial(data) {
  return request({
    url: '/invest/manage/getInvestMonthEquityDetial',
    method: 'post',
    data
  })
}

// 投资明细-直方图
export function monthlyEquityHistogram(data) {
  return request({
    url: '/invest/manage/monthlyEquityHistogram',
    method: 'post',
    data
  })
}

// 投资明细-风险指标
export function getInvestRiskInditor(data) {
  return request({
    url: '/invest/manage/getInvestRiskInditor',
    method: 'post',
    data
  })
}

// 投资明细-一个月三个月六个月收益夏普
export function findEquityBySegment(data) {
  return request({
    url: '/invest/manage/findEquityBySegment',
    method: 'post',
    data
  })
}

// 投资明细-头部信息
export function getInvestManageHeadDetial(data) {
  return request({
    url: '/invest/manage/getInvestManageHeadDetial',
    method: 'post',
    data
  })
}


//////////////////////////////  投资分组


export function addOrUpdateOrDeleteInvestGroup(data) {
  return request({
    url: '/invest/manage/addOrUpdateOrDeleteInvestGroup',
    method: 'post',
    data
  })
}

export function findGroupByPage(data) {
  return request({
    url: '/invest/manage/findGroupByPage',
    method: 'post',
    data
  })
}






